package cn.gson.springboot.controller;

import cn.gson.springboot.model.pojos.ChatRecord;
import cn.gson.springboot.model.service.ChatRecordService;
import cn.gson.springboot.model.vo.ChatRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ChatRecordController {
    @Autowired
    ChatRecordService chatService;

    @RequestMapping("/chat-record-list")
    @ResponseBody
    public List<ChatRecord> chatRecordList(Integer taskId){
        List<ChatRecord> chatRecords = chatService.selectChatRecordByTaskId(taskId);
        return chatRecords;
    }

    @RequestMapping("/save-chat-record")
    @ResponseBody
    public void saveChatRecord(@RequestBody ChatRecordVo vo){
        chatService.saveChatRecord(vo);
    }


}
